package com.itheima.demo;

import com.itheima.domain.Dept;
import com.itheima.domain.Emp;
import com.itheima.mapper.DeptMapper;
import com.itheima.utils.MapperUtil;

import java.util.List;

public class Demo {
    public static void main(String[] args) {
        DeptMapper mapper = MapperUtil.getMapper(DeptMapper.class);
        List<Dept> list = mapper.findAll();
        for (Dept dept : list) {
            System.out.println(dept.getDname());
            List<Emp> empList = dept.getEmpList();
            for (Emp emp : empList) {
                System.out.println(emp);
            }
        }

    }
}
